<template>
  <div class="box">
    <h4>孙组件标题</h4>
    <p>content11: {{content11}}</p>
    <p>content22: {{content22.name}}</p>
    <p>content1: {{content1}}</p>
    <button @click="updateContent1('abc')">更新祖组件的数据</button>
  </div>
</template>

<script>
export default {
  name: 'GrandChild',
  inject: ['content11', 'content22', 'updateContent1', 'getContent1'], // 声明注入的属性就会成为组件对象的属性
  computed: {
    content1 () {
      console.log('computed content1')
      return this.getContent1()
    }
  }
}
</script>

